package com.example.demo.util;

import java.util.concurrent.TimeUnit;

/**
 *
 * <p>@author Henry.Y</p>
 * <p>@date 2019-09-27</p>
 */
public class Example {

	public static void main(String[] args) {
		TimeUnit timeUnit= TimeUnit.DAYS;
		System.out.println(timeUnit.name());
		System.out.println(timeUnit.toDays(1));
		System.out.println(timeUnit.toHours(1));
		System.out.println(timeUnit.toMinutes(1));
		System.out.println(timeUnit.toSeconds(1));
		System.out.println(timeUnit.toMillis(1));
		System.out.println(timeUnit.toMicros(1));
		System.out.println(timeUnit.toNanos(1));
		System.out.println(timeUnit.convert(1, TimeUnit.DAYS));
		System.out.println(timeUnit.convert(120, TimeUnit.HOURS));
		System.out.println(timeUnit.convert(10000, TimeUnit.SECONDS));
	}
}
